-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Large refactoring of SaltClass #52407
Conversation
Hey everyone! |
Next things to do:
|
Wow, this is great! I'll definitely carve some time next week to test the PR. +1 for the matcher |
@max-arnold nice! |
This looks great already @a-a-abramov ! |
Just to keep thread alive, here's the list of fixed issues:
(implying node has classes A and E attached if it's not clear enough) #50688, #50501 - didn't check yet |
@a-a-abramov Thanks for the commit and addressing the many issues. I've found a small bug, we need to account for files that are blank. It looks like
Probably need to perform the same check on node.yml files. |
Globbing is back! Though I need an additional approve from you on it since I changed a bit of how it works - will explain tomorrow. |
So about globbing. I tried to make it intuitive and I think I succeeded. Basically it works like this:
The last thing is questionable, but my team decided that it's a lesser evil, because otherwise if you have a number of files and folders under A/B, all of them would be included EXCEPT init.yml. That's exactly the unintuitivity I wanted to avoid. What do you think?
Order of classes from resolved glob is alphanumeric - I get absolute path for each class yml file, sort it and keep it ordered during resolution. My thought was that instead of implementating some complex logic I'd better keep it as simple and predictable as possible. Also I don't think that globbing for deep subtrees is a way to go for anyone. |
Could anyone tell me what to do next? @Ch3LL? Failed tests confuse me a bit since I can't understand if it's my fault or not. It's also worth to notice that implementation from all the releases saltclass was in is severely bugged and unusable under any circumstances. This PR would be completed in a few days when I overcome my procrastination and finish user manual. |
Got some initial roadbumps during my testing (existing reclass-based state/pillar tree with obvious renames for saltclass):
The naming conflict above happens when there is a
On a positive note, refactored saltclass is able to detect duplicate keys:
Tested against a-a-abramov@2b8da76 |
You could probably borrow some useful bits from the release notes: https://docs.saltstack.com/en/latest/topics/releases/2018.3.0.html#new-saltclass-pillar-master-tops-modules |
@max-arnold And for the next error - good point, I completely forgot to test the module against python3. Will do it asap. |
Performance tests (#48167): 2018.3.4:
Profiling data (started at 2019.2@2b8da76:
Profiling data (started at The second graph looks much more dense, with the majority of time spent in Steps to reproduce:
The resulting Overall verdict: FIXED! Other issues are left for tomorrow. |
Fixed 2to3 issue |
@a-a-abramov Great work here but this needs to go to the develop branch instead of 2019.2 |
@dwoz This is a bugfix (albeit a large one). Saltclass is plagued by multiple problems from the moment it was merged in 2018.3 without proper QA (see the list of issues that is fixed by this PR). Things got even worse in 2019.2.0 - Saltclass is completely broken and doesn't work at all for many people, plus the original author is unresponsive for several months: It is unpractical to fix these bugs one-by-one because the implementation has too many defects and it is much simpler to just rewrite it. By rebasing this PR on top of the Since it is hard to break backward compatibility for the already broken feature, and the feature is experimental (it doesn't even have proper docs and only mentioned in 2018.3 release notes), please consider reverting your decision and allow us to rectify this mess in the nearest bugfix release (2019.2.1 or 2019.2.2) |
@max-arnold Thanks for explaining this more. We'll still need to make sure the linter, docs, and PR tests all pass to get this into 2019.2.1. |
@dwoz Thanks for understanding! How much time do we have to finalize the PR before 2019.2.1 is branched? |
Can someone decypher the lint error? Because I seem to be reading over it. |
Hello, Without wanting to add a mess to the mess I customized saltclass for my own need. Maybe I should wait for this to be merged first but here are the general ideas:
Currently the changes are limited regarding the current pull request, but I would prefer the current to be merged before adding more stuff. More especially I have no test cases :-(. What do you suggest? |
@ptitdoc this PR is pointing to a branch that is no longer being updated or supported. It will not be merged unless it is rebased and pointing to the current |
@sagetherage If this is closed, where does that leave SaltClass as part of SaltStack? At the very least I think the closure of this PR should lead to some clarification on that front, since as it stands it isn't really usable. |
@afletch this is only a PR that is pointing to the incorrect branch, is the reason for the closure. Work can still be accomplished and I can re-open, but someone from the community will need to commit to the work, rebase this against |
@sagetherage sorry, I was speaking about the PR as a whole, which it seems has stalled since @a-a-abramov no longer has the time to work on it. This PR was the 'hope for SaltClass' and without it - as even @a-a-abramov notes - SaltClass as distributed in SaltStack, is pretty much unusable. Therefore, my point was; if this PR is closed it signifies that SaltClass as pretty much abandoned. I raised this in Open Hour a few months back and there seemed little appetite beyond "someone needs to pick it up". Perhaps it should be removed (though I appreciate that's a discussion for elsewhere, not this PR). |
@afletch I hear you! I have also tried to find someone that is willing to even have this discussion! you can find me on saltstackcommunity.slack.com or keybase or IRC all with the same handle as here or you can email me [email protected] if you want to discuss further. I had someone in mind for this work but that fell through, recently. Still looking. |
Hey everyone! First of all I'm extremely sorry for abandoning this PR. At first I did not expect that simple rewriting and adding a couple of minor features would unravel real issues with the original code. And after a couple of weeks of struggling through the reviews (kudos to everyone involved!) tasks at work began to pile up with astounding rate and I had neither time and energy for this nor courage to let you guys know :( But! I left my job a couple of weeks before and now I have both time and energy to finally invest into saltclass. But I saw a couple of PRs featuring saltclass and don't really know if there's anything left to improve. If there is - let me know! I also think that we should first agree on the scope here. Ideally gather some feedback and/or requests from both the community and salt team. |
@a-a-abramov wondering if this may be a good candidate for a [salt-extension](Reviewed in Grooming 2021-MAY-03 closing), unsure, merely an idea. |
Are there any updates regarding this issue? |
Did you want to close this PR and open a new one when issues have been created around the other issues? @sagetherage 's suggestion is also a good one. If someone in the community is willing to maintain it we could create a saltclass pillar salt-extension project (https://github.com/saltstack/salt-extension) This would allow this module to be managed and release outside of Salt. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fwiw, this version works nicely, even with v3004
Tested with various live situations already.
Code wise
- Simpler logic, better to understand
- Faster
- better documented
Is anyone willing to follow through with this PR? |
I'm not sure why this couldn't be merged as-is. It fixes a lot of outstanding issues. I know there were some ideas of adding more bells and whistles to it, but for the basic functionality this patch is already way more stable and functional than what currently exists. I would really like to see this merged, I use saltclass to manage orchestration in testing envrionments, and I don't know of any other solution within salt that would allow effective management of large numbers of nodes that need lots of pillar data associated with them. |
The most recent comment from @a-a-abramov led me to belive there are still issues that need to be resolved. Also this will require a changelog to be added and it needs to be submitted against the master branch not 2019.2. |
Closing this PR due to inactivity and the target branch is wrong. If anyone wants to continue this PR, please open a new PR against the master branch with the changes and we can continue progressing these changes. |
What does this PR do?
Major refactor and bugfix of saltclass ext_pillar/master_tops utility.
What issues does this PR fix or reference?
Almost each one, that could be found by "saltclass" keyword in issues search. Previous discussions are here #51487 and here #51488
Tests written?
Yes
Commits signed with GPG?
Yes